package com.indusfo.spc.controller;

import com.indusfo.spc.service.BoardService;
import com.indusfo.spc.vo.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @ClassName BoardController
 * @Description TODO
 * @Author louk
 * @Date 2020/1/6 9:37
 * @Version 1.0
 */
@Controller
@RequestMapping("/service/board")
public class BoardController {

    @Resource
    BoardService boardService;

    /**
     * 总产线看板
     * @param fixedDeteId
     * @param dayNumber
     * @param endDate
     * @return
     */
    @ResponseBody
    @RequestMapping("/queryFixedDeteBoard")
    JSONObject queryFixedDeteBoard(Integer fixedDeteId,Integer dayNumber,String endDate){
        return boardService.queryFixedDetectionResult(fixedDeteId,dayNumber,endDate);
    }

    /**
     * 设备OEE看板
     * @param deviceId
     * @return
     */
    @ResponseBody
    @RequestMapping("/queryTubDeviceBoard")
    JSONObject queryTubDeviceBoard(Integer deviceId){
        return boardService.queryTubDeviceBoard(deviceId);
    }

    /**
     * 总装线工艺数据采集看板
     * @param fixedDeteIds
     * @param show
     * @return
     */
    @ResponseBody
    @RequestMapping("/queryProcessDataBoard")
    public JSONObject queryProcessDataBoard(Integer[] fixedDeteIds,Integer show,String time){
        return boardService.queryProcessDataBoard(fixedDeteIds,show,time);
    }
}
